<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>添加管理员</title>
		<link rel="stylesheet" type="text/css" media="screen"
			href="css/milk.css" />
		<link rel="stylesheet" type="text/css" media="screen"
			href="css/chili.css" />
		<script src="js/jquery.js" type="text/javascript"></script>
		<script src="js/jquery.validate.js" type="text/javascript"></script>

		<style type="text/css">
pre {
	text-align: left;
}
</style>

		<script id="demo" type="text/javascript">
$(document).ready(function() {
	// validate signup form on keyup and submit
	var validator = $("#signupform").validate({
		rules: {
			aname: {
				required: true,
				minlength: 6
			},
			apassword: {
				required: true,
				minlength: 6
			},
			reapassword: {
				required: true,
				minlength: 6,
				equalTo: "#apassword"
			},
			email: {
				required: true,
				email: true
			},
			dateformat: "required",
			terms: "required"
		},
		messages: {
			
			aname: {
				required: "用户名不能为空！",
				minlength: jQuery.format("输入不少与{0}字符！")
			},
			apassword: {
				required: "密码不能为空！",
				minlength: jQuery.format("输入不少与{0}字符！")
			},
			reapassword: {
				required: "确认密码不能为空！",
				minlength: jQuery.format("输入不少与{0}字符！"),
				equalTo: "两次输入密码不一致！"
			},
			email: {
				required: "Email不能为空！",
				minlength: "请输入正确的Email地址！"
			},
			dateformat: "",
			terms: ""
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
			if ( element.is(":radio") )
				error.appendTo( element.parent().next().next() );
			else if ( element.is(":checkbox") )
				error.appendTo ( element.next() );
			else
				error.appendTo( element.parent().next() );
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});
	
	// propose username by combining first- and lastname
});
</script>
	</head>
	<body>
		<h1 id="banner">
			添加管理员
		</h1>
		<!--标题-->
		<div id="main">

			<div id="content">

				<div id="header">
					<div id="headerlogo"></div>
				</div>
				<div class="content">
					<div id="signupbox">
						<div id="signuptab">
							<ul>
								<li id="signupcurrent">
									<a href="/Struts2new/admin/list2.action"><font
										color="#00CCFF">返回管理页面</font>
									</a>
								</li>
							</ul>
						</div>
						<div id="signupwrap">
							<form id="signupform" autocomplete="off" method="get"
								action="admin/aadd.action">
								<table>
									<tr>
										<td class="label">
											<label id="lusername" for="username">
												用户名
											</label>
										</td>
										<td class="field">
											<input id="aname" name="aname" type="text"
												maxlength="20" minlength="6" />
										</td>
										<td class="status"></td>
									</tr>
									<tr>
										<td class="label">
											<label id="lpassword" for="password">
												密码
											</label>
										</td>
										<td class="field">
											<input id="apassword" name="apassword" type="password"
												maxlength="20" minlength="6"/>
										</td>
										<td class="status"></td>
									</tr>
									<tr>
										<td class="label">
											<label id="lpassword_confirm" for="password_confirm">
												确认密码
											</label>
										</td>
										<td class="field">
											<input id="reapassword" name="reapassword"
												type="password" maxlength="20" minlength="6"/>
										</td>
										<td class="status"></td>
									</tr>
									<tr>
										<td class="label">
											<label id="lsignupsubmit" for="signupsubmit">
												注册
											</label>
										</td>
										<td class="field" colspan="2">
											<input type="submit" value="注册" />
										</td>
									</tr>
								</table>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
